var https = require('https');
var qs = require('querystring');

const param = qs.stringify({
	'grant_type': 'client_credentials',
	'client_id': 'TCs9N88mgNyBEOGhKGsWgzo3',
	'client_secret': 'tSgDmFCx5HGGH8oXixTEWA1bhRV7TfYB'
});

https.get({
		hostname: 'aip.baidubce.com',
		path: '/oauth/2.0/token?' + param,
		agent: false
	},
	function(res) {
		// 在标准输出中查看运行结果
		res.pipe(process.stdout);
	}
);

// {
// 	"refresh_token": "25.543d9a34020906768677602024cdcfba.315360000.1979196195.282335-27584508",
// 	"expires_in": 2592000,
// 	"session_key": "9mzdWW7YHkWdlaSrbv1\/S3wV\/trWOvd7JK\/u2oHATSiI8Mnbh2ipHqAV3wH+u\/kqgM78EZ8BvO7yHKlArLsIoBVMamB6IA==",
// 	"access_token": "24.b4dc88ca85d9a5c59b76e659a3f5584e.2592000.1666428195.282335-27584508",
// 	"scope": "public brain_all_scope vis-faceverify_faceverify_h5-face-liveness vis-faceverify_FACE_V3 vis-faceverify_idl_face_merge vis-faceverify_FACE_EFFECT vis-faceverify_face_beauty vis-faceverify_face_feature_sdk brain_face_scene_scope wise_adapt lebo_resource_base lightservice_public hetu_basic lightcms_map_poi kaidian_kaidian ApsMisTest_Test\u6743\u9650 vis-classify_flower lpq_\u5f00\u653e cop_helloScope ApsMis_fangdi_permission smartapp_snsapi_base smartapp_mapp_dev_manage iop_autocar oauth_tp_app smartapp_smart_game_openapi oauth_sessionkey smartapp_swanid_verify smartapp_opensource_openapi smartapp_opensource_recapi fake_face_detect_\u5f00\u653eScope vis-ocr_\u865a\u62df\u4eba\u7269\u52a9\u7406 idl-video_\u865a\u62df\u4eba\u7269\u52a9\u7406 smartapp_component smartapp_search_plugin avatar_video_test b2b_tp_openapi b2b_tp_openapi_online smartapp_gov_aladin_to_xcx",
// 	"session_secret": "31c7dc7d1d9c2a4c7e3c0ed74c385a78"
// }
